#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int n, m, l, r, c;
int q[N];
int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; i++)
        scanf("%d", &q[i]);
    while (m--)
    {
        scanf("%d%d%d", &l, &r, &c);
        for (int i = l; i <= r; i++)
            q[i] += c;
    }
    for (int i = 0; i < n; i++)
        printf("%d ", q[i]);
    return 0;
}